import request from '@/utils/request'

//登录
export const $_login = (params) => {
    return request.post('/student/login', params)
}
//注册
export const $_register = (params) => {
    return request.post('/student/reg', params)
}
//上传
export const $_uploadAvatar = (params) => {
    return request.post('/upload/upload-avatar', params)
}

// 查看用户
export const $_getUserInfo = (params) => {
    return request.get('/student/info', { params })
}

// 学生列表
export const $_getStudentList = (params) => {
    console.log('params', params);
    return request.get('/student/list', { params })
}

//发送邮箱验证码
export const $_sendEmailCode = (params) => {
    return request.post('/student/sendCode', params, )
}

//验证验证码是否正确
export const $_verifyCode = (params) => {
    return request.post('/student/verifyCode', params)
}

//导出excel表
// 在你的代码中，你尝试将responseType作为第三个参数传递给request.post()方法，但是axios库的post()方法并不直接接受responseType作为单独的参数。axios的post()方法通常接收以下参数：

// URL
// 数据（payload）
// 请求配置对象（包含headers, responseType等）
// 因此，你需要将responseType放入一个配置对象中，然后将其作为第三个参数传递。修正后的代码如下：


export const $_exportExcel = (params) => {
    const config = { responseType:'blob' };
    return request.post('/student/exportExcel',params,config)
}


//老师列表
export const $_getTeacherList = (params) => {
    return request.get('/users/teacher', { params })
}

//七牛上传图片
export const $_uploadQiniu = (params) => {
    return request.post('/qiniu', params )
}

